package com.todolist.mapper;

import com.todolist.dao.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    @Select("select * from user where username = #{username}")
    User getByUsername(String username);

    /**
     * 注册用户
     * @param user
     * @return
     */
    @Insert("INSERT INTO user (username, password) VALUES (#{username}, #{password}) ")
    void  register(User user);


}
